<template>
  <div class="app-container">
    <!-- 顶部Header区域 -->
    <mt-header fixed title="程序员vue项目"></mt-header>

    <!-- 中间的路由 router-view 区域 -->
     <transition>
       <router-view>
         
       </router-view>
     </transition>
      
    <!-- 底部Tabbar区域 --> 
    <nav class="mui-bar mui-bar-tab">
      <router-link class="mui-tab-item" to="/home">
        <span class="mui-icon mui-icon-home"></span>
        <span class="mui-tab-label">首页</span>
      </router-link>
      <router-link class="mui-tab-item" to="/member">
        <span class="mui-icon mui-icon-contact">
        </span>
        <span class="mui-tab-label">会员</span>
      </router-link>
      <router-link class="mui-tab-item" to="/shopcar">
        <span class="mui-icon mui-icon-extra mui-icon-extra-cart"><span class="mui-badge">0</span></span>
        <span class="mui-tab-label">购物车</span>
      </router-link>
      <router-link class="mui-tab-item" to="/search">
        <span class="mui-icon mui-icon-search"></span>
        <span class="mui-tab-label">搜索</span>
      </router-link>
    </nav>
  </div>
</template>

<script>
</script>


<style lang="scss" scoped>
.app-container {
  padding-top: 40px;
  padding-bottom: 50px;
  // 解决Header和Tabbar乱滑(位移)的问题,
    overflow-x: hidden;
}


// 进入状态,离开状态
.v-enter{
  opacity: 0;   //进入时设置为0,代表
  transform : translateX(100%);   //100% 代表从右边进来,渐变从不透明 0 到 1直至100%展示页面
  
}

.v-leave-to{
  opacity: 0;
  transform : translateX(-100%);  //100% 代表从左边出去,离开设备时从 1 渐变为不透明 0 直至页面100%消失
  position: absolute;
}

// 动画持续时间
.v-enter-active,
.v-leave-active{
  transition: all 0.5s ease;
}
</style>

